	 $(function(){
	 	
	 		// document.cookie="dw";
	 		if(document.cookie==""){
	 			$(".sign").show()
	 			$(".register").hide()
	 		}
	 		else{
	 			$(".sign").hide()
	 			$(".register").show()
	 		}
	 		// 扫一扫小图标js
	 		$(".qrcode1").hover(function(){
	 			$(this).hide()
	 			$(".qrcode2").show()
	 			$(".qrcode3").show()
	 		},function(){
	 			$(this).show()
	 			$(".qrcode2").hide()
	 			$(".qrcode3").hide()
	 		})
	 		
	 				
	 				// 搜索js
	 				$(".xl-menu-content span").hover(function(){
	 					$(this).css({
	 						"cursor":"pointer",
	 						"color":"black"
	 					})
	 				},function(){
	 					$(this).css({
	 						
	 						"color":"#5C5C5D"
	 					})
	 				})
	 				
	 				$(".xl").click(function(){
	 					$(this).hide()
	 					$(".xl-menu").toggle()
	 					$(".sl").toggle()
	 				})
	 				$(".sl").click(function(){
	 					$(this).hide()
	 					$(".xl-menu").toggle()
	 					$(".xl").toggle()
	 				})
	 				$(".xl-menu-content span").click(function(){
	 					let content="";
	 					let newcontent="";
	 					let title="";
	 					content=$(".search-input").val();
	 					title=$(this).text();
	 					console.log(title)
	 					newcontent=content.slice(-1)
	 					console.log(newcontent)
	 					if(newcontent==","){
	 						$(".search-input").val(content+title+",");
	 					}
	 					else{
	 						if(newcontent==""){
	 							$(".search-input").val(content+title+",");
	 						}
	 						else{
	 							$(".search-input").val(content+","+title+",");
	 						}
	 					}	
	 				})
	 				
	 				$(".ss").hover(function(){
	 					
	 					$(this).css({"color":'green'})
	 				},function(){
	 					$(this).css({"color":'#B2B2B2'})
	 				})
	 				
	 			
	 		$(".nav-collection-item1>div").each(function(i,el){
	 		$(this).click(function(){
	 			$(this).siblings().css("backgroundColor","")
	 
	 			$(".nav-collection-item2").empty();
	 			let content=listName[i].content
	 			for(let i=0;i<content.length;i++){
	 				var div=$("<div><div class='nav-collection-title'>"+content[i].title+"</div><div class='nav-collection-content'>"+content[i].content+"</div></div>")
	 				$(".nav-collection-item2").append(div)	
	 			}
	 			
	 			$(".nav-collection-title").css({
	 				"fontSize": "20px","width": "100%","height": "70%","textAlign": "left","lineHeight": "30px",
	 				"overflow": "hidden"
	 			});
	 					$(".nav-collection-content").css({
	 						"width": "100%",
	 						"height": "30%",
	 						"textAlign": "left","lineHeight":" 15px","fontSize": "10px",
	 						"overflow": "hidden"
	 					});
	 					$(".nav-collection-item>div").hover(function(){
	 						$(this).css({
	 							"cursor":"pointer",
	 							"backgroundColor":"#E9E7E7"
	 						})
	 					},function(){
	 						$(this).css({
	 							
	 							"backgroundColor":""
	 						})
	 					})
	 		})
	 		
	 	})
	 			$(".nav-collection-item>div").hover(function(){
	 				$(this).css({
	 					"cursor":"pointer",
	 					"backgroundColor":"#E9E7E7"
	 				})
	 			},function(){
	 				$(this).css({
	 					
	 					"backgroundColor":""
	 				})
	 			})
	 	
	 		$(".search-input").focus(function(){
	 			console.log('22')
	 			$('.search').css({
	 				"boxShadow": "0px 0px 0px 1px rgba(23,213,107,.5)",
	 			})
	 		})
	 		$(".search-input").blur(function(){
	 		  $(".search").css("boxShadow","");
	 		});
	 		
	 		$(".search-btn").click(function(){
	 			
	 			 var  getsearchinfo =$(".search-input").val();   
	 			  if(getsearchinfo==""){
	 				  $(".SearchInfo-tips").css("display","block");
	 			  }else{
	 				  $(".SearchInfo-tips").css("display","none");
	 				  document.location.href="搜索详情.html?searchinfo="+getsearchinfo;
	 				  console.log(getsearchinfo)
	 			  }
	 			    
	 		})
	 		$(".search-input").keyup(function(){
	 					  if(event.keyCode ==13){
	 					    $(".search-btn").trigger("click");
	 					  }
	 					
	 			})
	 		
	 		
	 		
	 		//获取搜索最多的几条热点数据
	 		var hotnewsList=[{title:"标题",content:"内容",playnums:5213},{title:"标题",content:"内容",playnums:5213},{title:"标题",content:"内容",playnums:5213},{title:"标题",content:"内容",playnums:5213},{title:"标题",content:"内容",playnums:5213},{title:"标题",content:"内容",playnums:5213}]
	 		$.ajax({
	 		          //请求方式
	 		          type : "get",
	 		         async:false,//同步
	 		          //请求地址
	 		          url : "http://localhost:3030/hotsearch",
	 		          
	 		          data :{},
	 		          //请求成功
	 		          success : function(result) {
	 		           hotnewsList=result.data;
	 					
	 					addhotnews(hotnewsList);
	 					  
	 		          },
	 		          //请求失败，包含具体的错误信息
	 		          error : function(e){
	 		             alert("热门搜索请求失败")
	 		          }
	 		      });
	 		
	 		
	 		
	 		//渲染热点搜索前四条的数据
	 		function addhotnews(list){
	 			let href="";
	 			if(list.length>4){
	 				for(let i=0;i<4;i++){
	 					href="经验详情.html?expId="+list[i].expId;
	 					var hotdiv=$(`<div class="hotNews-contents-item">
	 									<div class="hotNews-contents-title">
	 										<div class="hotNews-contents-titleItem1"><a href=${href}>${list[i].title}<a></div>
	 										<div class="hotNews-contents-titleItem2">${list[i].content.details}</div>
	 									</div>
	 									<span class="hotNews-contents-number">${list[i].browseNum}阅读量</span>
	 								</div>`)
	 								$(".hotNews-contents").append(hotdiv)
	 				}
	 			}else{
	 				$(".hotNews-title-extra").css("display","none");
	 				for(let i=0;i<list.length;i++){
	 					href="经验详情.html?expId="+list[i].expId;
	 					var hotdiv=$(`<div class="hotNews-contents-item">
	 									<div class="hotNews-contents-title">
	 										<div class="hotNews-contents-titleItem1"><a href="${href}">${list[i].title}<a></div>
	 										<div class="hotNews-contents-titleItem2">${list[i].content.details}</div>
	 									</div>
	 									<span class="hotNews-contents-number">${list[i].browseNum}阅读量</span>
	 								</div>`)
	 								$(".hotNews-contents").append(hotdiv)
	 			}
	 			}
	 		}
	 		
	 		
	 		
	 		//点击更多将所有热点数据渲染出来或收起来
	 		$(".hotNews-title-extra").click(function(){
	 			var list=hotnewsList;
	 			let href="";
	 			$(".hotNews-contents").empty();
	 			if($(".hotNews-title-extra").text()=="查看更多"){
	 				$(".hotNews-title-extra").text("收起")
	 				for(let i=0;i<list.length;i++){
	 					href="经验详情.html?expId="+list[i].expId;
	 						var hotdiv=$(`<div class="hotNews-contents-item">
	 										<div class="hotNews-contents-title">
	 											<div class="hotNews-contents-titleItem1"><a href="${href}" >${list[i].title}<a></div>
	 											<div class="hotNews-contents-titleItem2">${list[i].content.details}</div>
	 										</div>
	 										<span class="hotNews-contents-number">${list[i].browseNum}阅读量</span>
	 									</div>`)
	 									$(".hotNews-contents").append(hotdiv)
	 				}
	 				hotsearchHover()
	 			}else{
	 				$(".hotNews-title-extra").text("查看更多")
	 				for(let i=0;i<4;i++){
	 					href="经验详情.html?expId="+list[i].expId;
	 					var hotdiv=$(`<div class="hotNews-contents-item">
	 									<div class="hotNews-contents-title">
	 										<div class="hotNews-contents-titleItem1"><a href="${href}" >${list[i].title}<a></div>
	 										<div class="hotNews-contents-titleItem2">${list[i].content.details}</div>
	 									</div>
	 									<span class="hotNews-contents-number">${list[i].browseNum}阅读量</span>
	 								</div>`)
	 								$(".hotNews-contents").append(hotdiv)
	 				}
	 			hotsearchHover()
	 			}
	 		})
	 		
	 		//热点搜索js
	 	  function hotsearchHover(){
	 		  $(".hotNews-contents-item").hover(function(){
	 		  	
	 		  	$(this).children().children().css({
	 		  		
	 		  		"color":"#47D290",
	 		  	})
	 		  	
	 		  	$(this).children().children().children().css({
	 		  		
	 		  		"color":"#47D290",
	 		  	})
	 		  },function(){
	 		  	$(this).children().children().css("color","")
	 		  	$(this).children().children().children().css("color","")
	 		  })
	 	  }
	 	  hotsearchHover()
	 		
	 	
	 	
	 	
	 	
	 	
	 	
	 	
	 	
	 	
	 	
	 	
	 	
	 	
	 	
	 		
	 //final括号
	 })	
	